<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path= request.getContextPath();
	System.out.print(path);
	String basePath = request.getScheme() + "://"    + request.getServerName() + ":" + request.getServerPort()    + path + "/";
%>

<html>
<link rel="stylesheet" type="text/css" href="<%=path %>/pages/admin/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=path %>/pages/admin/easyui/themes/icon.css">
<script type="text/javascript" src="<%=path %>/pages/admin/easyui/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/pages/admin/easyui/jquery.easyui.min.js"></script>
<script>
$(function(){
			$('#test').datagrid({
				title:'',
				iconCls:'',
				width:700,
				height:350,
				nowrap: true,
				autoRowHeight: false,
				striped: true,
				collapsible:true,
				sortName: 'code',
				sortOrder: 'desc',
				remoteSort: false,
				pagination:true
			});
			var p = $('#test').datagrid('getPager');
			
			$(p).pagination({
				onBeforeRefresh:function(){
					alert('before refresh');
				},
				total:'<s:property value="page.totalNum" />' 				
			});
		});
</script>
<body>
<s:a namespace="/pages/admin" action="%{actionName}" method="form">新建</s:a>

<table class="easyui-datagrid" id="test"> 
	<thead>  
	     <tr> 
	        <th data-options="field:'ck'"></th> 
	        <th data-options="field:'code'">Code</th>  
	        <th data-options="field:'name'">Name</th>  
	        <th data-options="field:'rolename'">角色名</th>  
	        <th data-options="field:'password'">操作</th>  
	      </tr>  
	</thead>
	<tbody>
		<s:iterator value="page.list" status="rowstatus">
			<tr>
				<td><s:checkbox name="ck"></s:checkbox></td>
				<td><s:property
						value="#rowstatus.index+1+page.pageNum*page.pageSize" /></td>
				<td></td>
				<td><s:property value="name" /></td>
				<td><s:a namespace="/pages/admin" method="form"
						action="%{actionName}">
						<s:param name="id" value="%{id}"></s:param>
				修改</s:a>|
				<s:a namespace="/pages/admin" method="delete"
						action="%{actionName}" onclick="return confirm('确定要删除?')">
						<s:param name="id" value="%{id}"></s:param>
				删除</s:a></td>
			</tr>
		</s:iterator>
	</tbody>
</table>

</body>
</html>